/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cadenas;

/**
 *
 * @author Luis_Angel
 */
public class ComparacionString {

    public static void main(String[] args ){
        String a = "Hola";
        String b = "Hola";

        System.out.println(a==b);
        System.out.println(a.equals(b));

        String c = new String("Hola");
        String d = new String("Hola");

        System.out.println(c==d);
        System.out.println(c.equals(d));

        System.out.println(a==c);
        System.out.println(a.equals(c));
    }
}
